Crate bevy_kira_audio[][src]

Expand description

Audio plugin for the game engine Bevy

It uses the library Kira to play audio and offers an API to control running game audio via Bevy’s ECS.

fn main() {
   let mut app = App::new();
   app
        .add_plugins(MinimalPlugins)
        .add_plugin(AssetPlugin)
        .add_plugin(AudioPlugin)
        .add_startup_system(start_background_audio.system());
   app.run();
}

fn start_background_audio(asset_server: Res<AssetServer>, audio: Res<Audio>) {
    audio.play_looped(asset_server.load("background_audio.mp3"));
}

Structs

Bevy Audio Resource

A channel to play audio in

A Bevy plugin for audio

A source of audio data

A Bevy plugin for streaming of audio

A single Frame of an audio stream

Allows you to interact with a playing sound.

Use this resource to start and stop audio streams

Enums

Playback status of a currently playing sound.

Traits

An audio stream producing frames